#include <lpc23xx.h>
#include "LCD.h"
void FIQ_Handler(void) __irq; 	
int main (void)		 
{
    						 
//unsigned int delay;
				

PINSEL0         = 0x00000000;
PINSEL1         = 0x00000000;
PINSEL2         = 0x00000000;
PINSEL3         = 0x00000000;
PINSEL4         = 0x00000000;
PINSEL5         = 0x00000000;
PINSEL6         = 0x00000000;
PINSEL7         = 0x00000000;
PINSEL8         = 0x00000000;
PINSEL9         = 0x00000000;
PINSEL10        = 0x00000000;
    
      
IODIR0          = 0x00000000;
IODIR1          = 0x00000000;
IOSET0          = 0x00000000;
IOSET1          = 0x00000000;

FIO2DIR         = 0x000000FF;           //Configure the LED IO pins
FIO2MASK        = 0xFFFFFF00;
FIO2CLR         = 0x000000FF;   
    
PINSEL4 		    = 0x00100000;						//Enable the EXTINT0 interrupt

VICIntSelect    = 0x00004000;           //Convert the INT0 interrupt to an FIQ interrupt
VICIntEnable 	  = 0x00004000;						//enable interrupt
lcd_init();					   //
lcd_clear();				  //
set_cursor(2,0);			   // Agaf=/
lcd_print("FIQ Example");	 //



while(1)
{
FIO2SET         = 0x000000F0; 					//Idle
FIO2CLR			= 0x0000000F;					//Agaf
}
//return(0);
}

void FIQ_Handler(void)__irq
{
FIO2SET         = 0x0000000F;           //Switch on thelower nibble LEDs
EXTINT  		    = 0x00000001;						//Clear the peripheral interrupt flag
}
